﻿/// ---------------------------------------------
/// 2012.5.7
/// 汪定新
///
/// ---------------------------------------------

//双击事件
function CustomDbClick() {
    if (typeof (fnCustomEdit) == "function") {
        fnCustomEdit();
    }
}
//----------------------------------------------

//增加
var fnCustomAdd = function () {
    var list = this.mDataTable.getRecordSet()._records;
    var flag = false;
    for (var i = 0; i < list.length; i++) {
        if (list[i]._oData["AvilableStatus"] == "即将上岗") { //岗位申请已经提交待审核,则不能再提交
            flag = true;
            break;
        }
    }
    if (flag) {
        alert("该员工岗位申请已提交待审核生效,不能重复提交!");
        return;
    }
    document.getElementById("dialog1_h").innerHTML = "新增岗位异动信息";
    document.getElementById("EditUIWindow").src = "AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity;
    SetDWH(500, 300, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}
//编辑
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    if (record.getData("AvilableStatus") != "即将上岗")//已过期的和正在使用的不能修改
    {
        alert("该数据信息不能修改!");
        return;
    }
    document.getElementById("dialog1_h").innerHTML = "修改岗位异动信息";
    document.getElementById("EditUIWindow").src = "AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    SetDWH(500, 300, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}

var fnCustomDelete = function () {
    alert("不能删除岗位调整记录!");
    return;
}
//
var fnAddEduHistory = function () {
}
//初始化内置页面时
if (typeof ($) != "undefined") {
    $(document).ready(function () {
//        if (getPar1('id') == "") {
//            //alert(parent.parent.getPar1('id'));
//            instance[0].EmployeeID = parent.parent.getPar1('id');
//        }
    });
}
///数据验证
var fnCheckData = function () {
    
}
//